import MySQLdb

class __setConn__:
    def __init__(self, server, user, passwd, db):
        self.server = server
        self.user = user
        self.passwd = passwd
        self.db = db
        
        
    def makeConn(self):
        db = MySQLdb.connect(self.server, self.user, self.passwd, self.db)
        
    #def createInst(self, query):
    #    cursor = db.cursor()
    #    cursor.execute(query)
        
    def closeConn(self):
        db.close()
        
                             
    
server = "localhost"
user = "root"
passwd = "blackid"
db = "etik"

dataconn = __setConn__(server, user, passwd, db)
dataconn.makeConn()